|
Menu location |
---|
Draft → Line |
Workbenches |
Draft, Arch |
Default shortcut |
L I |
Introduced in version |
0.7 |
See also |
Draft Wire, Draft Point |
线段工具用于创建两点定义的线段。它根据Draft Tray中Draft Linestyle的设置来绘制线段。此工具与Draft Wire工具的行为基本相同,唯独线段工具在绘制完一条两点的线段即停止工作。
A Draft Line is in fact a Draft Wire with only two points.
根据两点创建一条线段
See also: Draft Tray, Draft Snap and Draft Constrain.
The single character keyboard shortcuts available in the task panel can be changed. See Draft Preferences. The shortcuts mentioned here are the default shortcuts (for version 1.0).
通过双击树状视图(tree view)中的元素或点击 Draft Edit按钮即可编辑对应线段。届时,您就可将构成线段的点移动到预定的新位置。
See also: Preferences Editor and Draft Preferences.
线段对象享有Draft Wire的所有属性,但是其中仅有部分属性适用于线段。
line = make_line(p1, p2)
line = make_line(LineSegment)
line = make_line(Shape)
p1
与点p2
间的一条 Line
对象,每个点由其FreeCAD.Vector
来定义,且以毫米为单位。Part.LineSegment
来创建一条Line
对象。Shape
的第一个顶点至最后一个顶点创建一条Line
对象。示例:
import FreeCAD as App
import Draft
doc = App.newDocument()
p1 = App.Vector(0, 0, 0)
p2 = App.Vector(1000, 500, 0)
p3 = App.Vector(-250, -500, 0)
p4 = App.Vector(500, 1000, 0)
line1 = Draft.make_line(p1, p2)
line2 = Draft.make_line(p3, p4)
doc.recompute()